package Person.ith_23;

import java.util.Scanner;

public class Test extends Person{
    static String[] uesrsexs={"男","女"};
    public static void main(String[] args) /**/{
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入你的性别");
        String usersex=sc.nextLine();
        System.out.println("请输入你的年龄");
        int useage=sc.nextInt();
        check(usersex);
        check(useage);
    }
    public static void check(int userage)/*throws AgeException*/{
        if(userage<=0&&userage>=120){
            try{
                throw new AgeException("年龄不符合正常人类");
            }catch (AgeException e){
                e.printStackTrace();
                return;
            }
        }System.out.println("恭喜你");


    }
    public static void check(String usersex)/*throws AgeException*/{
        String[] usersexs = new String[0];
        for(String sex:usersexs){
        if(sex.equals(usersex)){
            try{
                throw new SexException("性别不匹配啊");
            }catch (SexException e){
                e.printStackTrace();
                return;
            }
        }System.out.println("恭喜你");


    }
}}

 class AgeException extends Exception{

    public AgeException(){
        super();
    }
    public AgeException(int s){
        super(String.valueOf(s));
    }


    public AgeException(String 年龄不符合正常人类) {
    }
}

 class SexException extends Exception{

    public SexException(){
        super();
    }
    public SexException(String s){
        super(s);
    }


}

 class Person {
    private int age;
    private char sex;
    public int getAge() {
        return age;
    }
    public void setAge(int age){
        this.age=age;
    }
    public char getSex(){
        return sex;
    }
    public void setSex(char sex){
        this.sex = sex;
    }


}

